package com.example.demo_widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/**
 * @author yaotianxue
 * @description 组合view,比较常见
 * @date 2025/2/8
 */
public class SearchView extends FrameLayout {
    private View view;
    private ImageView imageView;
    private TextView textView;
    private EditText editText;
    public SearchView(@NonNull Context context) {
        super(context);
    }

    public SearchView(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        view = LayoutInflater.from(context).inflate(R.layout.layout_search_view,this);
        imageView = view.findViewById(R.id.iv);
        textView = view.findViewById(R.id.tv);
        editText = view.findViewById(R.id.et);

    }

    public SearchView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public SearchView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    public void setText(String text){
        textView.setText(text);
    }
    /**
     *
     */

}
